from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument,ExecuteProcess,TimerAction
from launch.conditions import IfCondition
from launch.substitutions import LaunchConfiguration,PythonExpression
from launch_ros.actions import Node

def generate_launch_description():
    new_background_r1 = LaunchConfiguration("new_background_r")

    return LaunchDescription([
        DeclareLaunchArgument(
            "new_background_r",
            default_value="120"
        ),
        Node(
            package="turtlesim",
            executable="turtlesim_node",
            name="turtlesim"
        ),
        ExecuteProcess(
            cmd=["ros2 param set /turtlesim background_r",new_background_r1],shell=True
        )
    ])
    